package com.example.synthesize.MapstructPlusDemo;

import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMapping;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
 * Created by IntelliJ IDEA2022.3.2
 * @Author: Tenghw
 * @Date: 2023/04/19  11:48
 * @Description:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@AutoMapper(target = UserDto.class)
public class User {
    private String username;
    private int age;
    private boolean young;
    @AutoMapping(target = "takeDownTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date takeDownTime;
    @AutoMapping(target = "price", numberFormat = "$#.00")
    private int price;
}
